package com.caibq;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * projectName: demo_box
 *
 * @author: 蔡百强
 * time: 2024/1/25 21:47 周四
 * description:
 */
@RestController
@RequestMapping(value = {"/user", "/secret/user"})
public class UserController {
    @RequestMapping("/list")
    Result<List<User>> listUser() {
        List<User> users = new ArrayList<>();
        User u = new User();
        u.setId(1);
        u.setName("boyka");
        u.setRegisterTime(LocalDateTime.now());
        u.setUserType(UserType.COMMON);
        users.add(u);
        Result<List<User>> response = new Result<>();
        response.setCode(200);
        response.setData(users);
        response.setMessage("用户列表查询成功");
        return response;
    }
}
